home *** CD-ROM | disk | FTP | other *** search
- // ===============================================================
- // Fragment Program: Invulnerability
- // Description: used in characters when in invulneability mode
- // Last Update: 02/09/2003
- // Coder: Tiago Sousa
- // ===============================================================
-
-
- #include "../CGVPMacro.csi"
-
-
- MainInput { uniform sampler2D bumpMap : texunit0,
- uniform sampler2D refMap : texunit1,
- uniform float4 Matrix,
- uniform float4 Amount
- }
-
- DeclarationsScript
- {
- OUT_T0_T1
- FOUT
- }
-
- CoreScript
- {
- // load the decal
- float4 bumpColor = tex2D(bumpMap, IN.Tex0.xy);
- float4 refrColor = offsettex2D(refMap, IN.Tex1.xy, bumpColor, Matrix);
-
- // get brightest color..
- float fBrightest=dot(float3(0,1,0), refrColor.xyz);
- fBrightest*=fBrightest;
- fBrightest*=fBrightest;
-
- OUT.Color.xyz = fBrightest*Amount.w*Amount.xyz;
- OUT.Color.w= fBrightest*Amount.w;
- }